<template>
    <div class="blog-post">
    <h4>{{ book.title }}
        <el-input v-model="book.title"></el-input>
    </h4>
    <h4>
      属性传值  看console 控制台
    </h4>
    <el-input v-model="ptitle" @change="changevalue"></el-input>
    <button @click="changeSize">Enlarge text</button> 


  </div>
</template>
<script setup lang="ts"> 
  import { PropType,ref } from "vue";
import { BookModel } from "./type"; 
 const props = defineProps({
    book:{
        type: Object as PropType<BookModel> | any,
    },
    defaultblogtitle:[String , Number]
 }) 
 const ptitle = ref(props.defaultblogtitle);
 const emit = defineEmits(["fontSize","update:defaultblogtitle"])

 function changeSize(){
    emit('fontSize', props.book?.title);
 }
 function changevalue(e : any){   
  emit('update:defaultblogtitle', e);
 }
</script>
